package com.liu.yupao.model.enums;
/**
 * @author lqh
 * @since 2025-08-30 19:54
 */
public enum UserRoleEnum {
    USER("user","user"),
    ADMIN("admin","admin");

    private final String text;
    private final String value;

    UserRoleEnum(String text,String value){
        this.text=text;
        this.value=value;
    }

    //根据value找到枚举类
    public UserRoleEnum findByValue(String value){
        for (UserRoleEnum userRoleEnum : UserRoleEnum.values ()) {
            if (userRoleEnum.value.equals (value)){
                return userRoleEnum;
            }
        }
        return null;
    }

    public String getText(){
        return this.text;
    }

    public String getValue(){
        return this.value;
    }
}
